//2014-8-8 HW3
/*
virtual01VO.setThick((String) map.get("THICK"));//厚度 =====>錯誤
virtual01VO.setThick(map.get("THICK").toString());//厚度 ====>錯誤
virtual01VO.setThick((String) map.get("THICK").toString());//厚度 ====>正確

作業3 : virtual01VO.setThick((String) map.get("THICK").toString());//厚度 
====>正確為什麼要ToString後又要轉型String呢? 用MAP來測試
 */

package LearnWork;

import java.util.HashMap;
import java.util.Map;

public class MapToStringTest {
	
	public static void main(String[] args) {
		Map myMap = new HashMap();
		String Key = "0";
		myMap.put( Key,new Double("3.3"));
		
		
		System.out.print(myMap.get(Key) + "-");
		System.out.println(myMap.get(String.valueOf(0)).getClass() + "\n");
		//--
		System.out.print(myMap.get(Key).toString() + "-");
		System.out.println(myMap.get(Key).toString().getClass() + "\n");
		//--
		System.out.print(((String)myMap.get(Key).toString() + "-"));
		System.out.println(((String)myMap.get(Key).toString()).getClass() + "\n");
		//--
		System.out.println(
				myMap.get(Key).getClass().equals
				(myMap.get(Key).toString().getClass()));
		//--
		System.out.println(
				(myMap.get(Key).toString().getClass().equals
				(((String)myMap.get(Key).toString()).getClass())));
		
	}

}
